<?php

namespace App\Models\Admin;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Communicationlog extends Model
{
    protected $table_name = 'communicationlog';

    protected $fillable = [
        'id','member_id', 'admin_user_id', 'comm_time','contentlog','created_at','updated_at'
    ];

    public function communicationLogInsert($data)
    {
        $data['created_at'] = Carbon::now()->toDateTimeString();
        $data['updated_at'] = Carbon::now()->toDateTimeString();
        $data["mall_id"] = request()->mallData["id"];
        $res = DB::table($this->table_name)->insert($data);
        if(!$res){
            return false;
        }
        return true;
    }
}
